package com.boot.admin.modules.sys.ai.model.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * AI对话会话VO
 *
 * @author 李飞洋
 * @date 2025/9/24
 */
@Data
@EqualsAndHashCode
@ToString
public class AiConversationVO implements Serializable {
    @Schema(description = "id")
    private String id;

    @Schema(description = "创建人")
    private String createdBy;

    @Schema(description = "创建时间")
    private LocalDateTime created;

    @Schema(description = "更新人")
    private String modifiedBy;

    @Schema(description = "更新时间")
    private LocalDateTime modified;

    @Schema(description = "用户ID")
    private String userId;

    @Schema(description = "角色ID")
    private String roleId;

    @Schema(description = "角色名称")
    private String roleName;

    @Schema(description = "会话标题")
    private String title;

    @Schema(description = "会话状态")
    private Integer status;

    @Schema(description = "角色头像URL")
    private String avatarUrl;

    @Schema(description = "最后消息时间")
    private LocalDateTime lastMessageTime;

    @Schema(description = "是否启用")
    private Integer isEnabled;

    @Schema(description = "消息列表")
    private List<AiMessageVO> messages;

    @Schema(description = "是否活跃")
    public boolean isActive() {
        return status == 1;
    }

    @Schema(description = "是否启用")
    public boolean isEnabled() {
        if (null == isEnabled) {
            return false;
        }
        return isEnabled == 1;
    }
}